1. Field of the Invention
The present invention relates to the design of processors within computer systems. More specifically, the present invention relates to a method and apparatus for reducing the time required to access a register file during execution of an instruction within a pipelined processor.
2. Related Art
As processor clock speeds continue to increase at an exponential rate, it is becoming progressively harder to ensure that the circuitry within the processors keeps pace with the increasing clock speeds. A processor typically uses a fast register file to store operands for instructions. This allows the processor to the read operands for computational operations from the register file, instead of taking the additional time to retrieve the operands from cache or memory.
Because of the way programs are designed, each function within a program typically operates on its own set of registers. Hence, the processor's “active register set” changes each time the current function changes, for example during a function call operation or a function return operation. This change can involve saving the current register set to memory during a function call operation to make room for a register set for the new function, and subsequently restoring the current register set from memory during a corresponding function return operation. Unfortunately, this process of saving and restoring register sets to memory is extremely time-consuming and can significantly degrade computer system performance.
In order to deal with this problem, modern computer architectures typically make use of a large set of registers to reduce the time required to perform save and restore operations. This large set of registers is typically divided into a number of “register windows,” wherein each register window contains the register set for a different function on the call stack. This makes it possible to simply switch between register windows during a function call operation, instead of having to save and restore registers to memory.
Unfortunately, as register files increase in size and as clock speeds continue to increase, additional clock cycles are needed to access the large register files. These additional clock cycles increase the pipeline depth of the processor, and can thereby adversely affect processor performance.
What is needed is a method and an apparatus for accessing registers within a large register file without requiring additional processor cycles.